package com.mlog.njyjy.ndop.monitor.pojo;

import lombok.Data;

@Data
public class EventVO {

	private String host;
	private String hostid;
	private String hostname;
	private String ip;
	private String available;
	private int totalNum;
	private int lv0Num;
	private int lv1Num;
	private int lv2Num;
	private int lv3Num;
	private int lv4Num;
	private int lv5Num;
	private int highestLv;

	public void autoAdd(String level) {
		switch (level) {
		case "0":
			lv0Num++;
			break;
		case "1":
			lv1Num++;
			break;
		case "2":
			lv2Num++;
			break;
		case "3":
			lv3Num++;
			break;
		case "4":
			lv4Num++;
			break;
		case "5":
			lv5Num++;
			break;
		}
		totalNum++;
		if(lv5Num > 0)
			highestLv = 5;
		else if(lv4Num > 0)
			highestLv = 4;
		else if(lv3Num > 0)
			highestLv = 3;
		else if(lv2Num > 0)
			highestLv = 2;
		else if(lv1Num > 0)
			highestLv = 1;
		else 
			highestLv = 0;
	}
}
